## Makefile.am for the TeX Live subdirectory texk/web2c/otps/
##
## Copyright (C) 2009-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
##
AM_CPPFLAGS = -I$(top_builddir)/.. -I$(top_srcdir) $(KPATHSEA_INCLUDES)
AM_CFLAGS = $(WARNING_CFLAGS)
AM_YFLAGS = -d -v

proglib = ../lib/lib.a

# Rebuild $(proglib)
$(proglib): ${top_srcdir}/lib/*.c
	cd ../lib && $(MAKE) $(AM_MAKEFLAGS)

## Rebuild libkpathsea
@KPATHSEA_RULE@

otps_programs = otp2ocp outocp
otps_scripts = mkocp mkofm

noinst_HEADERS = otp.h routines.h yystype.h

if OTANGLE
bin_PROGRAMS = $(otps_programs)
if WIN32
SUBDIRS = win32
else !WIN32
bin_SCRIPTS = $(otps_scripts)
endif !WIN32
man1_MANS = $(otps_mans)
endif OTANGLE
EXTRA_PROGRAMS = $(otps_programs)
otps_mans = $(otps_programs:=.man) $(otps_scripts:=.man)

EXTRA_DIST = $(otps_scripts) $(otps_mans)

otp2ocp_SOURCES = \
	otp-parser.y \
	otp-lexer.l \
	otp2ocp.c \
	routines.c

DISTCLEANFILES = otp-parser.output

outocp_SOURCES = \
	outocp.c

LDADD = $(proglib) $(KPATHSEA_LIBS)
otp2ocp_DEPENDENCIES = $(proglib) $(KPATHSEA_DEPEND)
outocp_DEPENDENCIES = $(proglib) $(KPATHSEA_DEPEND)

## Tests
##
if OTANGLE
TESTS = otp2ocp.test outocp.test
endif OTANGLE
otp2ocp.log: otp2ocp$(EXEEXT)
outocp.log: outocp$(EXEEXT)

EXTRA_DIST += \
	otp2ocp.test \
	outocp.test \
	uni2lat.ocp \
	uni2lat.otp \
	uni2lat.out

## Files generated by TESTS
##
CLEANFILES = xuni2lat.ocp xuni2lat.out

## Not used
##
EXTRA_DIST += bugs.txt

